8c1fa94723878e6c7a890fb46ff9d8dc47cbef4e
4 * transforme un raccourci de ressource en un lien minimaliste
9 define('_EXTRAIRE_RESSOURCES', ',' . '<"?(https?://|[\w -]+\.[\w -]+)[^<]*>'.',UimsS');
12 function traiter_ressources($r) {
13 if ($ressource = charger_fonction('ressource', 'inc', true)) {
14 $html = $ressource($r[0]);
16 include_spip('inc/lien');
17 $url = explode(' ', trim($r[0], '<>'));
19 # <http://url/absolue>
20 if (preg_match(',^https?://,i', $url))
21 $html = propre("<span class='ressource spip_out'><[->".$url."]></span>");
23 else if (false !== strpos($url, '/'))
24 $html = propre("<span class='ressource spip_in'><[->".$url."]></span>");
27 preg_match(',\.([^.]+)$,', $url, $regs);
28 if (file_exists($f = _DIR_IMG
.$regs[1].'/'.$url)) {
29 $html = propre("<span class='ressource spip_in'><[".$url."->".$f."]></span>");
31 $html = propre("<span class='ressource'><".$url."></span>");
36 return '<html>'.$html.'</html>';